<template lang="html">
  <div class="coupon_item">
<<<<<<< HEAD
    <div class="coupon_box">
      <div class="coupon_box_left">
        <img src="https://shopsuite.yaoyingli.com/wechat/images/activity/buy_car.png" alt="">
      </div>
      <div class="coupon_box_right">
        <div class="coupon_box_content_top">
          <h3 class="title">98 <span>元尊享会员礼包</span></h3>
          <div class="tag">
            开通会员 >
=======
    <div class="coupon_box" @click="goBuy">
      <div class="coupon_box_left">
        <img :src="item.product_image" alt="">
      </div>
      <div class="coupon_box_right">
        <div class="coupon_box_content_top">
          <h3 class="title"><em>{{item.product_unit_price}}</em> <span>元尊享会员礼包</span></h3>
          <div class="tag">
            开通会员 <em></em>
>>>>>>> v2
          </div>
        </div>
        <div class="coupon_box_content_bottom">
          <div class="price">
            <div class="price_top">
              <img src="../../../assets/image/coupon_grant/song.png" alt="">
<<<<<<< HEAD
              <p><span>￥</span>100</p>
            </div>
            <div class="price_bottom">
              满减优惠券
            </div>
          </div>
          <div class="rule">
            礼包内含：美的4L电火锅+200元超值满减券+多重尊享权益
=======
              <p><span>￥</span>{{item.coupon_total}}</p>
            </div>
            <div class="price_bottom">
              {{item.coupon_type}}
            </div>
          </div>
          <div class="rule">
            礼包内含：{{item.gift_have}}
>>>>>>> v2
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Tool from '@/utils/tool.js'
import Path from '@/utils/path.js'
// import  'vue-circle-progress/dist/circle-progress.css'
export default {
  props: ['item'],
  data () {
    return {
      is_show: false,
      is_received: false
    }
  },
  created () {
    if (this.$props.item.receive_status) {
      this.is_received = true
    }
  },
  methods: {
    goUsed () {
      let isClient = Tool.isClient()
      if (isClient) {
        window.location = 'yggback://'
      } else {
        window.location = Path() + '/'
      }
    },
    showRule () {
      this.is_show = !this.is_show
    },
<<<<<<< HEAD
=======
    goBuy () {
      let isMini = sessionStorage.getItem('isMini')
      let item = this.item
      let params = '?pid=' + item.product_id + '&item_id=' + item.default_item_id
      if (isMini) {
        window.wx.miniProgram.navigateTo({ url: '/pages/shopDetails/shopDetails' + params })
      } else {
        this.$router.push('/main/shopDetails' + params)
      }
    },
>>>>>>> v2
    getCoupon (id, unreceived) {
      if (unreceived) {
        var data = {
          activity_id: id
        }
        return new Promise((resolve, reject) => {
          this.$Axios({ url: 'shop_user_voucher', data, method: 'post' }).then((resp) => { // 请求成功
            if (resp.return_code === '0000') {
              this.is_received = true
              this.$toast('领取成功！')
            } else {
              this.$toast(resp.return_msg)
            }
            resolve(resp)
          }).catch((error) => { // 请求失败
            this.$_requestInterceptor('error', error)
            reject(error)
          })
        })
      } else {
        this.$toast('去首页看看')
      }
    }
  }
}
</script>

<style lang="css" scoped>
</style>
